package com.mc2014.follow_me_2014;

import java.util.Map;

import com.android.volley.Request.Method;
import com.android.volley.AuthFailureError;
import com.android.volley.RequestQueue;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.mc2014.util.Define_Value;

import android.os.Bundle;
import android.app.Activity;
import android.app.DownloadManager.Request;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class MainActivity extends Activity implements OnClickListener {

	ImageView splash;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		splash = (ImageView) findViewById(R.id.splash_img);
		splash.setOnClickListener(this);
		RequestQueue queue = Volley.newRequestQueue(MainActivity.this);
		Listener<String> login_listener = new Listener<String>() {

			public void onResponse(String response) {
				// TODO Auto-generated method stub
				
			}
		};
		ErrorListener errorlistener = new ErrorListener() {

			@Override
			public void onErrorResponse(VolleyError error) {
				// TODO Auto-generated method stub

			}
		};
		StringRequest loginRequest = new StringRequest(Define_Value.URL
				+ Define_Value.URL_AUTH_TOKEN, login_listener, errorlistener){
			@Override
			protected Map<String, String> getParams()
					throws AuthFailureError {
				// TODO Auto-generated method stub
				return super.getParams();
			}
		};
		queue.add(loginRequest);
	}

	@Override
	public void onClick(View v) {
		Intent i = new Intent(MainActivity.this, WelcomeActivity.class);
		startActivity(i);
		finish();
		
	}

}
